public class Text {
    public static void main(String[] args) {
      /*  int[] arr = {1,2,4};
        int max = arr[0];
        int maxIndex = 0;
        for(int i = 1; i < arr.length;i++){
            if(max < arr[i]){
                max = arr[i];
                maxIndex = i;
            }
        }
        System.out.println("最大值是" + max + " 最大值的下标是" + maxIndex);

*/
        /*int[] arr1 = {1,2,3,4};
        int[] arr2 = arr1;
        arr2[0] = 99;
        System.out.println(arr1[0]);
*/


    /*    //数组拷贝
        int[] arr1 = {1,2,3,45,56};
        int[] arr2 = new int[5];
        for(int i = 0; i < arr1.length; i++){
            arr2[i] = arr1[i];
        }
        for (int i = 0; i < arr2.length; i++) {
            System.out.println(arr2[i]);
        }*/
       /* //数组反转
        int[] arr1 = {1,2,3,4,5,6,7};
        int[] arr2 = new int[7];
        for (int i = arr1.length-1; i >= 0 ; i--) {
            for (int i1 = 0; i1 < arr2.length; i1++) {
                arr2[i1] = arr1[i];
            }
        }
        for (int i = 0; i < arr2.length; i++) {
            System.out.println(arr2[i]);
        }*/

       /* for(int i = 0; i < arr1.length; i++){
            for(int j = arr2.length -1;j >= 0;j--){
                arr2[j] = arr1[i];
            }
        }
        for (int i = 0; i < arr2.length; i++) {
            System.out.println(arr2[i]);
        }*/
        //数组反转
       /* int[] arr1 = {11,22,33,44,55,66};
        int tmp = 0;
        int len = arr1.length;
       for(int i = 0; i < len / 2; i++){
           tmp = arr1[len - 1 - i];
           arr1[len - 1 -i] = arr1[i];
           arr1[i] = tmp;
       }
        for (int i = 0; i < arr1.length; i++) {
            System.out.println(arr1[i]);
        }*/

        //数组反转第一种方法
        /*int[] arr = {11,22,33,44,55,66};
        int tmp = 0;
        int len = arr.length;
        for(int i = 0; i < len / 2; i++){
            tmp = arr[len -i -1];
            arr[len -i-1] = arr[i];
            arr[i] = tmp;
        }
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }
        */
       /* int[] arr = {11,22,33,44,55,66};
        int[] arr2  = new int[arr.length];
        //逆序遍历
        for(int i = arr.length -1,j = 0; i >= 0; i--,j++){
            arr2[j] = arr[i];
        }
        arr = arr2;
        for (int i = 0; i < arr2.length; i++) {
            System.out.println(arr2[i]);
        }
*/


       int[] arr = {11,22,33,44,55,66};
       int[] arr2 = new int[arr.length];
       for(int i = arr.length -1, j = 0; j < arr2.length; i--,j++){
           arr2[j] = arr[i];
       }
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr2[i]);
        }
    }
}
